package com.inc.admin.service.biz.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.inc.admin.dao.biz.BookClassificationMapper;
import com.inc.admin.dao.biz.BookHistoryMapper;
import com.inc.admin.domain.biz.BookClassification;
import com.inc.admin.service.biz.BookClassificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author admin
* @description 针对表【book_classification】的数据库操作Service实现
* @createDate 2024-10-30 21:29:03
*/
@Service
public class BookClassificationServiceImpl implements BookClassificationService{

    @Resource
    private BookClassificationMapper bookClassificationMapper;

    @Override
    public Object listByPage(BookClassification req) {
        PageHelper.startPage(req.getPageNo(), req.getPageSize());
        List<BookClassification> list = bookClassificationMapper.select();
        return new PageInfo<>(list);
    }

    @Override
    public int insert(BookClassification req) {
        int result = bookClassificationMapper.insert(req);
        return result;
    }

    @Override
    public int update(BookClassification req) {
        int result = bookClassificationMapper.update(req);
        return result;
    }

    @Override
    public int delete(Integer id) {
        int result = bookClassificationMapper.delete(id);
        return result;
    }
}
